home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / Slots.p < prev    next >
Encoding:
Text File  |  1991-04-03  |  11.1 KB  |  310 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {}
  4. {Created: Sunday, January 6, 1991 at 11:16 PM}
  5. {    Slots.p}
  6. {    Pascal Interface to the Macintosh Libraries}
  7. {}
  8. {        Copyright Apple Computer, Inc.    1986-1990}
  9. {        All rights reserved}
  10. {}
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17.  
  18. unit Slots;
  19. interface
  20.     uses
  21.         Types, OSUtils, Files;
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.     const
  45.         fCardIsChanged = 1;                                 {Card is Changed field in StatusFlags field of sInfoArray}
  46.         fCkForSame = 0;                                     {For SearchSRT. Flag to check for SAME sResource in the table. }
  47.         fCkForNext = 1;                                     {For SearchSRT. Flag to check for NEXT sResource in the table. }
  48.         fWarmStart = 2;                                     {If this bit is set then warm start else cold start.}
  49.  
  50.         stateNil = 0;                                       {State}
  51.         stateSDMInit = 1;                                   {:Slot declaration manager Init}
  52.         statePRAMInit = 2;                                  {:sPRAM record init}
  53.         statePInit = 3;                                     {:Primary init}
  54.         stateSInit = 4;                                     {:Secondary init}
  55.  
  56. { flags for spParamData }
  57.         fall = 0;                                           { bit 0: set=search enabled/disabled sRsrc's }
  58.         foneslot = 1;                                       {       1: set=search sRsrc's in given slot only }
  59.         fnext = 2;                                          {       2: set=search for next sRsrc }
  60.  
  61.     type
  62.         SQElemPtr = ^SlotIntQElement;
  63.         SlotIntQElement = record
  64.                 sqLink: Ptr;                                    {ptr to next element}
  65.                 sqType: INTEGER;                                {queue type ID for validity}
  66.                 sqPrio: INTEGER;                                {priority}
  67.                 sqAddr: ProcPtr;                                {interrupt service routine}
  68.                 sqParm: LONGINT;                                {optional A1 parameter}
  69.             end;
  70.  
  71.         SpBlockPtr = ^SpBlock;
  72.         SpBlock = packed record
  73.                 spResult: LONGINT;                              {FUNCTION Result}
  74.                 spsPointer: Ptr;                                {structure pointer}
  75.                 spSize: LONGINT;                                {size of structure}
  76.                 spOffsetData: LONGINT;                          {offset/data field used by sOffsetData}
  77.                 spIOFileName: Ptr;                              {ptr to IOFile name for sDisDrvrName}
  78.                 spsExecPBlk: Ptr;                               {pointer to sExec parameter block.}
  79.                 spParamData: LONGINT;                           {misc parameter data (formerly spStackPtr).}
  80.                 spMisc: LONGINT;                                {misc field for SDM.}
  81.                 spReserved: LONGINT;                            {reserved for future expansion}
  82.                 spIOReserved: INTEGER;                          {Reserved field of Slot Resource Table}
  83.                 spRefNum: INTEGER;                              {RefNum}
  84.                 spCategory: INTEGER;                            {sType: Category}
  85.                 spCType: INTEGER;                               {Type}
  86.                 spDrvrSW: INTEGER;                              {DrvrSW}
  87.                 spDrvrHW: INTEGER;                              {DrvrHW}
  88.                 spTBMask: SignedByte;                           {type bit mask bits 0..3 mask words 0..3}
  89.                 spSlot: SignedByte;                             {slot number}
  90.                 spID: SignedByte;                               {structure ID}
  91.                 spExtDev: SignedByte;                           {ID of the external device}
  92.                 spHwDev: SignedByte;                            {Id of the hardware device.}
  93.                 spByteLanes: SignedByte;                        {bytelanes from card ROM format block}
  94.                 spFlags: SignedByte;                            {standard flags}
  95.                 spKey: SignedByte;                              {Internal use only}
  96.             end;
  97.  
  98.         SInfoRecPtr = ^SInfoRecord;
  99.         SInfoRecord = packed record
  100.                 siDirPtr: Ptr;                                  {Pointer to directory}
  101.                 siInitStatusA: INTEGER;                         {initialization E}
  102.                 siInitStatusV: INTEGER;                         {status returned by vendor init code}
  103.                 siState: SignedByte;                            {initialization state}
  104.                 siCPUByteLanes: SignedByte;                     {0=[d0..d7] 1=[d8..d15]}
  105.                 siTopOfROM: SignedByte;                         {Top of ROM= $FssFFFFx: x is TopOfROM}
  106.                 siStatusFlags: SignedByte;                      {bit 0 - card is changed}
  107.                 siTOConst: INTEGER;                             {Time Out C for BusErr}
  108.                 siReserved: packed array[0..1] of SignedByte;  {reserved}
  109.                 siROMAddr: Ptr;                                 { addr of top of ROM }
  110.                 siSlot: CHAR;                                   { slot number }
  111.                 siPadding: packed array[0..2] of SignedByte;   { reserved }
  112.             end;
  113.  
  114.         SDMRecord = packed record
  115.                 sdBEVSave: ProcPtr;                             {Save old BusErr vector}
  116.                 sdBusErrProc: ProcPtr;                          {Go here to determine if it is a BusErr}
  117.                 sdErrorEntry: ProcPtr;                          {Go here if BusErrProc finds real BusErr}
  118.                 sdReserved: LONGINT;                            {Reserved}
  119.             end;
  120.  
  121.         FHeaderRecPtr = ^FHeaderRec;
  122.         FHeaderRec = packed record
  123.                 fhDirOffset: LONGINT;                           {offset to directory}
  124.                 fhLength: LONGINT;                              {length of ROM}
  125.                 fhCRC: LONGINT;                                 {CRC}
  126.                 fhROMRev: SignedByte;                           {revision of ROM}
  127.                 fhFormat: SignedByte;                           {format - 2}
  128.                 fhTstPat: LONGINT;                              {test pattern}
  129.                 fhReserved: SignedByte;                         {reserved}
  130.                 fhByteLanes: SignedByte;                        {ByteLanes}
  131.             end;
  132.  
  133.         SEBlock = packed record
  134.                 seSlot: SignedByte;                             {Slot number.}
  135.                 sesRsrcId: SignedByte;                          {sResource Id.}
  136.                 seStatus: INTEGER;                              {Status of code executed by sExec.}
  137.                 seFlags: SignedByte;                            {Flags}
  138.                 seFiller0: SignedByte;                          {Filler, must be SignedByte to align on odd boundry}
  139.                 seFiller1: SignedByte;                          {Filler}
  140.                 seFiller2: SignedByte;                          {Filler}
  141.                 seResult: LONGINT;                              {Result of sLoad.}
  142.                 seIOFileName: LONGINT;                          {Pointer to IOFile name.}
  143.                 seDevice: SignedByte;                           {Which device to read from.}
  144.                 sePartition: SignedByte;                        {The partition.}
  145.                 seOSType: SignedByte;                           {Type of OS.}
  146.                 seReserved: SignedByte;                         {Reserved field.}
  147.                 seRefNum: SignedByte;                           {RefNum of the driver.}
  148.                 seNumDevices: SignedByte;                       { Number of devices to load.}
  149.                 seBootState: SignedByte;                        {State of StartBoot code.}
  150.             end;
  151.  
  152.  
  153.  
  154. {  Principle  }
  155.     function SReadByte (spBlkPtr: SpBlockPtr): OSErr;
  156.     inline
  157.         $205F, $7000, $A06E, $3E80;
  158.     function SReadWord (spBlkPtr: SpBlockPtr): OSErr;
  159.     inline
  160.         $205F, $7001, $A06E, $3E80;
  161.     function SReadLong (spBlkPtr: SpBlockPtr): OSErr;
  162.     inline
  163.         $205F, $7002, $A06E, $3E80;
  164.     function SGetCString (spBlkPtr: SpBlockPtr): OSErr;
  165.     inline
  166.         $205F, $7003, $A06E, $3E80;
  167.     function SGetBlock (spBlkPtr: SpBlockPtr): OSErr;
  168.     inline
  169.         $205F, $7005, $A06E, $3E80;
  170.     function SFindStruct (spBlkPtr: SpBlockPtr): OSErr;
  171.     inline
  172.         $205F, $7006, $A06E, $3E80;
  173.     function SReadStruct (spBlkPtr: SpBlockPtr): OSErr;
  174.     inline
  175.         $205F, $7007, $A06E, $3E80;
  176.  
  177.  
  178. {  Special  }
  179.     function SReadInfo (spBlkPtr: SpBlockPtr): OSErr;
  180.     inline
  181.         $205F, $7010, $A06E, $3E80;
  182.     function SReadPRAMRec (spBlkPtr: SpBlockPtr): OSErr;
  183.     inline
  184.         $205F, $7011, $A06E, $3E80;
  185.     function SPutPRAMRec (spBlkPtr: SpBlockPtr): OSErr;
  186.     inline
  187.         $205F, $7012, $A06E, $3E80;
  188.     function SReadFHeader (spBlkPtr: SpBlockPtr): OSErr;
  189.     inline
  190.         $205F, $7013, $A06E, $3E80;
  191.     function SNextSRsrc (spBlkPtr: SpBlockPtr): OSErr;
  192.     inline
  193.         $205F, $7014, $A06E, $3E80;
  194.     function SNextTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr;
  195.     inline
  196.         $205F, $7015, $A06E, $3E80;
  197.     function SRsrcInfo (spBlkPtr: SpBlockPtr): OSErr;
  198.     inline
  199.         $205F, $7016, $A06E, $3E80;
  200.     function SCkCardStat (spBlkPtr: SpBlockPtr): OSErr;
  201.     inline
  202.         $205F, $7018, $A06E, $3E80;
  203.     function SReadDrvrName (spBlkPtr: SpBlockPtr): OSErr;
  204.     inline
  205.         $205F, $7019, $A06E, $3E80;
  206.     function SFindDevBase (spBlkPtr: SpBlockPtr): OSErr;
  207.     inline
  208.         $205F, $701B, $A06E, $3E80;
  209.     function SFindBigDevBase (spBlkPtr: SpBlockPtr): OSErr;
  210.     inline
  211.         $205F, $701C, $A06E, $3E80;
  212.  
  213.  
  214. {  Advanced  }
  215.     function InitSDeclMgr (spBlkPtr: SpBlockPtr): OSErr;
  216.     inline
  217.         $205F, $7020, $A06E, $3E80;
  218.     function SPrimaryInit (spBlkPtr: SpBlockPtr): OSErr;
  219.     inline
  220.         $205F, $7021, $A06E, $3E80;
  221.     function SCardChanged (spBlkPtr: SpBlockPtr): OSErr;
  222.     inline
  223.         $205F, $7022, $A06E, $3E80;
  224.     function SExec (spBlkPtr: SpBlockPtr): OSErr;
  225.     inline
  226.         $205F, $7023, $A06E, $3E80;
  227.     function SOffsetData (spBlkPtr: SpBlockPtr): OSErr;
  228.     inline
  229.         $205F, $7024, $A06E, $3E80;
  230.     function SInitPRAMRecs (spBlkPtr: SpBlockPtr): OSErr;
  231.     inline
  232.         $205F, $7025, $A06E, $3E80;
  233.     function SReadPBSize (spBlkPtr: SpBlockPtr): OSErr;
  234.     inline
  235.         $205F, $7026, $A06E, $3E80;
  236.     function SCalcStep (spBlkPtr: SpBlockPtr): OSErr;
  237.     inline
  238.         $205F, $7028, $A06E, $3E80;
  239.     function SInitSRsrcTable (spBlkPtr: SpBlockPtr): OSErr;
  240.     inline
  241.         $205F, $7029, $A06E, $3E80;
  242.     function SSearchSRT (spBlkPtr: SpBlockPtr): OSErr;
  243.     inline
  244.         $205F, $702A, $A06E, $3E80;
  245.     function SUpdateSRT (spBlkPtr: SpBlockPtr): OSErr;
  246.     inline
  247.         $205F, $702B, $A06E, $3E80;
  248.     function SCalcSPointer (spBlkPtr: SpBlockPtr): OSErr;
  249.     inline
  250.         $205F, $702C, $A06E, $3E80;
  251.     function SGetDriver (spBlkPtr: SpBlockPtr): OSErr;
  252.     inline
  253.         $205F, $702D, $A06E, $3E80;
  254.     function SPtrToSlot (spBlkPtr: SpBlockPtr): OSErr;
  255.     inline
  256.         $205F, $702E, $A06E, $3E80;
  257.     function SFindSInfoRecPtr (spBlkPtr: SpBlockPtr): OSErr;
  258.     inline
  259.         $205F, $702F, $A06E, $3E80;
  260.     function SFindSRsrcPtr (spBlkPtr: SpBlockPtr): OSErr;
  261.     inline
  262.         $205F, $7030, $A06E, $3E80;
  263.     function SDeleteSRTRec (spBlkPtr: SpBlockPtr): OSErr;
  264.     inline
  265.         $205F, $7031, $A06E, $3E80;
  266.  
  267.     function OpenSlot (paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  268.     function OpenSlotSync (paramBlock: ParmBlkPtr): OSErr;
  269.     inline
  270.         $205F, $A200, $3E80;
  271.     function OpenSlotAsync (paramBlock: ParmBlkPtr): OSErr;
  272.     inline
  273.         $205F, $A600, $3E80;
  274.  
  275.  
  276. {  Device Manager Slot Support  }
  277.     function SIntInstall (sIntQElemPtr: SQElemPtr; theSlot: INTEGER): OSErr;
  278.     inline
  279.         $301F, $205F, $A075, $3E80;
  280.     function SIntRemove (sIntQElemPtr: SQElemPtr; theSlot: INTEGER): OSErr;
  281.     inline
  282.         $301F, $205F, $A076, $3E80;
  283.  
  284.     function SVersion (spBlkPtr: SpBlockPtr): OSErr;
  285.     inline
  286.         $205F, $7008, $A06E, $3E80;
  287.     function SetSRsrcState (spBlkPtr: SpBlockPtr): OSErr;
  288.     inline
  289.         $205F, $7009, $A06E, $3E80;
  290.     function InsertSRTRec (spBlkPtr: SpBlockPtr): OSErr;
  291.     inline
  292.         $205F, $700A, $A06E, $3E80;
  293.     function SGetSRsrc (spBlkPtr: SpBlockPtr): OSErr;
  294.     inline
  295.         $205F, $700B, $A06E, $3E80;
  296.     function SGetTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr;
  297.     inline
  298.         $205F, $700C, $A06E, $3E80;
  299.     function SGetSRsrcPtr (spBlkPtr: SpBlockPtr): OSErr;
  300.     inline
  301.         $205F, $701D, $A06E, $3E80;
  302.  
  303.  
  304.     { UsingSlots }
  305.  
  306.  
  307. implementation
  308. end.
  309.  
  310.